<template>
  <div id="gashaponList"> 


        <el-table :data="datalist" style="width: 100%" :height="dtheight" :header-cell-style="{background:'#4F81BC',color:'white'}"
           :row-class-name="tableRowClassName"  :border="true">
            
                <el-table-column label="账号"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.member_info.telphone }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="姓名"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span >{{ scope.row.member_info.nickname }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="收货手机"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span v-if="scope.row.adss">{{ scope.row.adss.telphone }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="收货姓名"  align='center' >                   
                    <template slot-scope="scope">                   
                        <span v-if="scope.row.adss">{{ scope.row.adss.username }}</span>
                    </template>
                </el-table-column>
                <el-table-column label="收货地址"  align='center'  width="200">                   
                    <template slot-scope="scope">                   
                        <span v-if="scope.row.adss">{{ scope.row.adss.region }},{{ scope.row.adss.detail }}</span>
                    </template>
                </el-table-column>
                 <el-table-column label="快递信息"  align='center' width="250">                   
                    <template slot-scope="scope">                   
                        <span v-if="scope.row.status == 1">
                             快递公司:{{ scope.row.express_compnay}} <br>
                             快递单号:{{ scope.row.express_number}}
                        </span>
                    </template>
                </el-table-column>
                 <el-table-column label="操作" align='center' width="100" fixed="right">
                    <template slot-scope="scope">                           
                        <el-button  size="mini"  type="primary"  plain  v-if="scope.row.status == 0" @click="fh_but(scope.row)">发货</el-button>                          
                    </template>
                </el-table-column>
        </el-table> 


          <!-- 发货 -->
        <el-dialog title="发货" :visible.sync="fh_mtk"  width="350px">
            <div style="width:100%;"> 

            <el-form ref="form"   label-width="70px" style="width:100%;"> 
                <el-form-item label="" label-width="0px">
                        <el-input    v-model="mtk_form.express_compnay" placeholder="快递公司"></el-input>
                </el-form-item>       
                 <el-form-item label="" label-width="0px">
                        <el-input    v-model="mtk_form.express_number" placeholder="订单号"></el-input>
                </el-form-item>                
                                       
            </el-form>

                <div style="text-align: center;width:50%;margin:auto;">
                    <el-button type="primary" class="custom_color_button" style="width:80%;"  @click="fh_but_qr">确认</el-button>
                </div>

            </div> 
        </el-dialog>

   </div>
</template>

<script>

export default {
   name: 'gashaponList',
   props:{
      datalist:{  
        //type:Array,
       default:()=>[]
     },
  },
  data () {
    return {
        dtheight:'500',  //窗口高度
        fh_mtk:false,
        mtk_form:{
            express_compnay:'',
            express_number:'',
        },
        my_id:''
    }
  },
   components:{

  },
  created(){
     this.dtheight = window.innerHeight - 298

  },
  mounted (){
    
  },
  methods: { 
    fh_but(row){
        this.fh_mtk = true
        this.my_id = row.id
        this.mtk_form.express_compnay = ''
        this.mtk_form.express_number = ''
    },
    fh_but_qr(){
         this.post("/blind_box/deliver", {
                  id:this.my_id,
                  express_compnay:this.mtk_form.express_compnay,
                  express_number:this.mtk_form.express_number
                }).then(res => {
                    if(res.error_code == 0){
                    this.open1(res.result,'success')  //提示框
                    this.fh_mtk = false
                    this.$emit('up_list_fun')
                    }else {
                    this.open1(res.message,'warning')
                }

        })
    }
  }
}
</script>


<style scoped>

</style>